<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style >
				.red-text{
					color:red;
				}
		</style>
	</head>
	<body>
		<input type="button"id="btn"value="变颜色" /><br/>
		<span id="span">sssss</span>
		
	</body>
	<script type="text/javascript">
		window.onload=function() {
			let oBtn=document.getElementById('BTN')
			oBtn.onclick=function() {
				document.getElementById('span').className='red-text'
				document.getElementById('span').innerHTML
				="<span id='span' class='red-text'>sssss</span>"
			}
		}
	</script>
</html>
